package com.yqb.study.common.log;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;

import com.yqb.study.common.bean.SpringContextHolder;
import com.yqb.study.modular.persistence.model.OperateLog;

import java.io.Serializable;

/**
 * 为log保存被修改的bean临时存放的地方
 */
@Component
@Scope(scopeName = WebApplicationContext.SCOPE_SESSION)
public class LogObjectHolder implements Serializable {

	private Object object = null;
	
	private OperateLog operateLog = null;

	public OperateLog getOperateLog() {
		return operateLog;
	}

	public void setOperateLog(OperateLog operateLog) {
		this.operateLog = operateLog;
	}

	public void setObject(Object obj) {
		this.object = obj;
	}

	public Object getObject() {
		return object;
	}

	public static LogObjectHolder me() {
		LogObjectHolder bean = SpringContextHolder.getBean(LogObjectHolder.class);
		return bean;
	}
}
